home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip: 2005 Utilities
/
CHIP Utilities 2005.7z
/
CHIP Utilities 2005.iso
/
images
/
arachne.igz
/
arachne.img
/
LEVEL1
/
ASPIUSB.CAB
/
Bin
/
Aspiusb.bat
next >
Wrap
DOS Batch File
|
2005-01-16
|
7KB
|
235 lines
@if "%debug%"=="" echo off
if "%1"==":" if not "%2"=="" goto %2
:: Aspiusb Begin ::
if not exist %ramdrv%\bin\lmod.com %0 : _error missing lmod.com (check utils.%arcext%)
if not exist %ramdrv%\bin\varset.com %0 : _error missing varset.com (check utilz.%arcext%)
:_start
echo. >%tmp%\_usb.tmp
if not exist %ramdrv%\etc\global.set goto _noglob
type %ramdrv%\etc\global.set >%tmp%\_usb.tmp
:_noglob
if not exist %ramdrv%\etc\aspiusb.set goto _nospec
type %ramdrv%\etc\aspiusb.set >%tmp%\_usb.tmp
:_nospec
xgrep -sy "^[:s]*@*[:s]*s?e?t?[:s]*USB_.+=" %tmp%\_usb.tmp >%tmp%\_usb.bak
if errorlevel 1 goto _noset
xgrep -sy "^[:s]*@*[:s]*set[:s]+" %tmp%\_usb.bak >%tmp%\_usb.bat
xgrep -syv "^[:s]*@*[:s]*set[:s]+" %tmp%\_usb.bak >%tmp%\_usb.tmp
if errorlevel 1 goto _runset
lmod /L* set []<%tmp%\_usb.tmp >>%tmp%\_usb.bat
:_runset
call %tmp%\_usb.bat
:_noset
if not "%usb_ti%"=="" goto _nodef
set usb_ti=5
set usb_verbose=1
set usb_host=1
:_nodef
for %%i in (-c -C) do if "%1"=="%%i" goto _config
if "%1"=="/c" goto _config
if "%1"=="/C" goto _config
for %%i in (-h -H -?) do if "%1"=="%%i" goto _usage
if "%1"=="/h" goto _usage
if "%1"=="/H" goto _usage
if "%1"=="/?" goto _usage
if "%usb_ncfg%"=="1" goto _nocfg
set wcb1=%usb_install%
call w.bat box @%0:w_cfg #2,%usb_ti%
if errorlevel 3 goto _end
set usb_install=%wcb1%
if errorlevel 2 goto _config
:_nocfg
:_install
if not exist %ramdrv%\bin\usbaspi.sys goto _skipinst
if "%usb_install%"=="1" goto _doinst
:_skipinst
echo ASPIUSB: Skipping USB installation
goto _end
:_doinst
if not exist SCSIMGR$ goto _do2inst
echo ASPIUSB: USBASPI.SYS already installed
goto _skipASPI
:_do2inst
set _usb=
if "%usb_ehci%"=="1" set _usb=%_usb% /e
if "%usb_ohci%"=="1" set _usb=%_usb% /o
if "%usb_uhci%"=="1" set _usb=%_usb% /u
if "%usb_verbose%"=="1" set _usb=%_usb% /v
if "%usb_wait%"=="1" set _usb=%_usb% /w
if "%usb_resident%"=="1" set _usb=%_usb% /r
if "%usb_slow%"=="1" set _usb=%_usb% /slow
if "%usb_nocbc%"=="1" set _usb=%_usb% /nocbc
if "%usb_noprt%"=="1" set _usb=%_usb% /noprt
if "%usb_norst%"=="1" set _usb=%_usb% /norst
if not "%usb_extra%"=="" set _usb=%_usb% %usb_extra%
echo ASPIUSB: new PC prefers EHCI (/e), old PC prefers UHCI (/u)
echo ASPIUSB: USB-mouse/keyboard may malfunction with UHCI (/u)
echo ASPIUSB: Installing USBASPI.SYS %_usb%
if exist %ramdrv%\bin\snap.com snap.com S=%tmp%\usbaspi.bin
device %ramdrv%\bin\usbaspi.sys %_usb%
if not exist SCSIMGR$ if exist %tmp%\usbaspi.bin del %tmp%\usbaspi.bin >%tmp%\nul
:_skipASPI
set _usb=
if exist SCSIMGR$ goto _instok
echo ASPIUSB: USBASPI.SYS not installed (no USB device detected)
goto _end
:_instok
if "%usb_nodisk%"=="1" goto _skipDD
if not exist %ramdrv%\bin\di1000dd.sys goto _skipDD
if not "%usb_host%"=="" set _usb=/h%usb_host%
if not "%usb_drv%"=="" set _usb=%_usb% /d%usb_drv%
echo ASPIUSB: Installing DI1000DD.SYS %_usb%
if exist %ramdrv%\bin\snap.com snap.com S=%tmp%\di1000dd.bin
call devhigh %ramdrv%\bin\di1000dd.sys %_usb%
:_skipDD
set _usb=
goto _end
:_config
echo :w_config "USB configuration" [x]>%tmp%\_usb.tmp
echo.>>%tmp%\_usb.tmp
echo Dialog timeout [$ usb_ti,3] seconds>>%tmp%\_usb.tmp
echo [!] Skip "Run USB or go config?" dialog>>%tmp%\_usb.tmp
echo.>>%tmp%\_usb.tmp
echo [.] Install USB to ASPI/SCSI driver: >>%tmp%\_usb.tmp
echo On 'new' PC pick EHCI only, on 'old' PC UHCI only>>%tmp%\_usb.tmp
echo [!] Ehci USB 2.0 (new PC) >>%tmp%\_usb.tmp
echo [!] Ohci USB 1.1 add-on >>%tmp%\_usb.tmp
echo [!] Uhci USB 1.1 integrated (old PC) >>%tmp%\_usb.tmp
echo [!] Verbose (show info, recommended) >>%tmp%\_usb.tmp
echo [!] Wait (pause to attach USB device) >>%tmp%\_usb.tmp
echo [!] Resident (use when booting from USB flop) >>%tmp%\_usb.tmp
echo [!] Slow (use longer delays with USB detection) >>%tmp%\_usb.tmp
echo [!] NoReset (no Reset on USB Keyb/Mouse) >>%tmp%\_usb.tmp
echo.>>%tmp%\_usb.tmp
echo Install USB ASPI Mass Storage Driver:>>%tmp%\_usb.tmp
echo [$ usb_host,1] Host Controller (1..9 or blank for auto) >>%tmp%\_usb.tmp
echo [$ usb_drv,1,U] First Drive Letter (blank for auto) >>%tmp%\_usb.tmp
if "%ramdrv%"=="" goto _tref
echo (choose higher drive than '%ramdrv%' or leave blank) >>%tmp%\_usb.tmp
:_tref
echo [.] Do NOT install USB to ASPI/SCSI driver >>%tmp%\_usb.tmp
goto _qaw
echo.>>%tmp%\_usb.tmp
echo [!] NoCBC (no Card Bus Controller detection) >>%tmp%\_usb.tmp
echo [!] NoPRT (? no Printer detection ?) >>%tmp%\_usb.tmp
:_qaw
echo.>>%tmp%\_usb.tmp
echo [ Save ] [? Cancel ]>>%tmp%\_usb.tmp
set wrb=%usb_install%
if not "%wrb%"=="1" set wrb=2
set wcb1=%usb_ncfg%
set wcb2=%usb_ehci%
set wcb3=%usb_ohci%
set wcb4=%usb_uhci%
set wcb5=%usb_verbose%
set wcb6=%usb_wait%
set wcb7=%usb_resident%
set wcb8=%usb_slow%
set wcb9=%usb_norst%
call w.bat box @%tmp%\_usb.tmp:w_config
if errorlevel 2 goto _end
set usb_install=%wrb%
if not "%wrb%"=="1" set usb_install=0
set usb_ncfg=%wcb1%
set usb_ehci=%wcb2%
set usb_ohci=%wcb3%
set usb_uhci=%wcb4%
set usb_verbose=%wcb5%
set usb_wait=%wcb6%
set usb_resident=%wcb7%
set usb_slow=%wcb8%
set usb_norst=%wcb9%
set t_out=1
call drd.bat %srcdrv%
if errorlevel 1 set t_out=0
wbat box @%0:w_wprot #1,%t_out%
set t_out=
if errorlevel 2 goto _start
echo ASPIUSB: Saving configuration...
set | tfind /f1,4 "USB_">%tmp%\_usb.bat
if not exist %srcdrv%\etc\*.* mkdir %srcdrv%\etc
if not exist %ramdrv%\etc\global.set goto _yglob
xgrep -syv "^[:s]*@*[:s]*s?e?t?[:s]*USB_.+=" %ramdrv%\etc\global.set >>%tmp%\_usb.bat
:_yglob
type %tmp%\_usb.bat >%srcdrv%\etc\global.set
type %tmp%\_usb.bat >%ramdrv%\etc\global.set
if exist %srcdrv%\etc\aspiusb.set del %srcdrv%\etc\aspiusb.set >%tmp%\nul
if exist %ramdrv%\etc\aspiusb.set del %ramdrv%\etc\aspiusb.set >%tmp%\nul
echo ASPIUSB: Configuration saved to %srcdrv%\etc\global.set
echo.
goto _start
:w_cfg "Run USB or go config?" [x]
(~press any key~: #? sec.)
[!] Running ASPIUSB ...
(Skip running ASPIUSB when it
disables your USB-Keyboard
and/or USB-Mouse or try
enabling EHCI-only)
[ Ok ] [ Config ] [? Abort ]
::
:w_wprot "Disable write protection..." [x]
If the disk in drive %srcdrv% is write
protected, please disable the write
protection now in order to save settings.
You can re-enable write protection after
saving.
[ Ok ] [? Cancel ]
::
:_usage
echo Parameters:
echo -c Config mode
echo -h This help info
echo.
goto _end
:_error
shift
shift
echo.
echo ASPIUSB: Error %1 %2 %3 %4 %5 %6 %7 %8
echo.
@rem pause
goto _end
:_abort
echo ASPIUSB: Aborted...
echo.
@rem pause
:_end
set | tfind /f1,2 "W_" >%tmp%\_usb.tmp
set | tfind /f1,4 "USB_" >>%tmp%\_usb.tmp
type %tmp%\_usb.tmp | lmod /L* /B= set [$1]=>%tmp%\_usb.bat
call %tmp%\_usb.bat
if exist %tmp%\_usb.* del %tmp%\_usb.*
set _usb=
set ?=
set wcb1=
set wcb2=
set wcb3=
set wcb4=
set wcb5=
set wcb6=
set wcb7=
set wcb8=
set wcb9=
set wrb=
set wbat=
:: Aspiusb End ::